home *** CD-ROM | disk | FTP | other *** search
Wrap
//begin_lib <!-- Begin External JavaScript -- DO NOT REMOVE THIS LINE --> var el; var clTimer = null; var time; var clDay=new Array(" Sunday"," Monday"," Tuesday"," Wednesday"," Thursday"," Friday"," Saturday"); var clMonth=new Array(" January "," Febuary "," March "," April "," May "," June "," July "," August "," September "," October "," November "," December "); function jsClock(){ this.SetElement = cl_SetElement; this.GetShortTime = cl_GetShortTime; this.GetShortTimeDate = cl_GetShortTimeDate; this.GetLongTimeDate = cl_GetLongTimeDate; this.StopNow = cl_StopNow; } function get_Hours(){ return ((time.getHours() >12) ? time.getHours() -12 : time.getHours());; } function get_Minutes(){ return ((time.getMinutes() < 10) ? ":0" : ":") +time.getMinutes(); } function get_Seconds(){ var retValue = ((time.getSeconds() < 10) ? ":0" : ":") +time.getSeconds(); retValue+= ((time.getHours() >=12) ? " P.M." : " A.M."); return retValue; } function get_WeekDay(){ return clDay[time.getDay()]; } function get_Month(){ return clMonth[time.getMonth()]; } function setValue(val){ if(el){ el.value =val; }else{ window.status = val; } } function cl_SetElement(element){ el = element; } function cl_GetShortTime(){ time = new Date(); var retValue = get_Hours()+get_Minutes()+get_Seconds(); setValue(retValue); clTimer = setTimeout("cl_GetShortTime()",1000); } function cl_GetShortTimeDate(){ time = new Date(); var retValue = get_Hours()+get_Minutes()+get_Seconds()+" "+(time.getMonth()+1)+"/"+time.getDate()+"/"+time.getFullYear(); setValue(retValue); clTimer = setTimeout("cl_GetShortTimeDate()",1000); } function cl_GetLongTimeDate(){ time = new Date(); var retValue = get_Hours()+get_Minutes()+get_Seconds()+" "+get_WeekDay()+", "+get_Month()+" "+time.getDate()+", "+time.getFullYear(); setValue(retValue); clTimer = setTimeout("cl_GetLongTimeDate()",1000); } function cl_StopNow(){ clearTimeout(clTimer); } //end_lib <!-- End External JavaScript -- DO NOT REMOVE THIS LINE -->